{switch name="$field['type']"}
{case value="string"}<!-- 字符串 -->
<div class="layui-form-item">
    <label class="layui-form-label">{$field['title']}{if condition="isset($field['is_must'])&&$field['is_must']"}&nbsp;<font color="red">*</font>{/if}</label>
    <div class="layui-input-block">
        <input type="text" name="{$field.name}" value="{$field.value}" placeholder="" autocomplete="off" class="layui-input upload-text">
        {if condition="$field['remark']"}<span class="layui-form-mid layui-word-aux">[ {$field.remark} ]</span>{/if}
        <span class="sysval"><em class="zerocopy">{$field.name}</em></span>
    </div>
</div>
{/case}
{case value="textarea"}<!-- 文本框 -->
<div class="layui-form-item layui-form-text">
    <label class="layui-form-label">{$field['title']}{if condition="isset($field['is_must'])&&$field['is_must']"}&nbsp;<font color="red">*</font>{/if}<span class="sysval"><em class="zerocopy">{$field.name}</em></span></label>
    <div class="layui-input-block">
        <textarea name="{$field.name}" placeholder="" class="layui-textarea upload-text">{$field.value}</textarea>
        {if condition="$field['remark']"}<span class="layui-form-mid layui-word-aux">[ {$field.remark} ]</span>{/if}
    </div>
</div>
{/case}
{case value="num"}<!-- 数字 -->
<div class="layui-form-item">
    <label class="layui-form-label">{$field['title']}{if condition="isset($field['is_must'])&&$field['is_must']"}&nbsp;<font color="red">*</font>{/if}</label>
    <div class="layui-input-inline">
        <input type="text" name="{$field.name}" value="{$field.value}" placeholder="" autocomplete="off" class="layui-input upload-text" style="height:38px">
        {if condition="$field['remark']"}<span class="layui-form-mid layui-word-aux">[ {$field.remark} ]</span>{/if}
        <span class="sysval"><em class="zerocopy">{$field.name}</em></span>
    </div>
</div>
{/case}
{case value="float"}<!-- 小数类型 -->
<div class="layui-form-item">
    <label class="layui-form-label">{$field['title']}{if condition="isset($field['is_must'])&&$field['is_must']"}&nbsp;<font color="red">*</font>{/if}</label>
    <div class="layui-input-inline">
        <input type="text" name="{$field.name}" value="{$field.value}" placeholder="" autocomplete="off" class="layui-input upload-text" style="height:38px">
        {if condition="$field['remark']"}<span class="layui-form-mid layui-word-aux">[ {$field.remark} ]</span>{/if}
        <span class="sysval"><em class="zerocopy">{$field.name}</em></span>
    </div>
</div>
{/case}
{case value="decimal"}<!-- 金额类型 -->
<div class="layui-form-item">
    <label class="layui-form-label">{$field['title']}{if condition="isset($field['is_must'])&&$field['is_must']"}&nbsp;<font color="red">*</font>{/if}</label>
    <div class="layui-input-inline">
        <input type="text" name="{$field.name}" value="{$field.value}" placeholder="" autocomplete="off" class="layui-input upload-text" style="height:38px">
        {if condition="$field['remark']"}<span class="layui-form-mid layui-word-aux">[ {$field.remark} ]</span>{/if}
        <span class="sysval"><em class="zerocopy">{$field.name}</em></span>
    </div>
</div>
{/case}
{case value="tags"}<!-- 标签 -->
<div class="layui-form-item">
    <label class="layui-form-label">{$field['title']}{if condition="isset($field['is_must'])&&$field['is_must']"}&nbsp;<font color="red">*</font>{/if}</label>
    <div class="layui-input-block" style="border: none;">
        <input type="text" name="{$field.name}" value="{$field.value}" class="layui-input form-tags tags-{$field.name} upload-text" data-remark="{$field.value|default='输入后空格确认'}">
        {if condition="$field['remark']"}<span class="layui-form-mid layui-word-aux">[ {$field.remark} ]</span>{/if}
        <span class="sysval"><em class="zerocopy">{$field.name}</em></span>
    </div>
</div>
{/case}
{case value="array"}<!-- 数组 -->
{if condition="1"}
<div class="layui-form-item">
    <label class="layui-form-label">{$field['title']}{if condition="isset($field['is_must'])&&$field['is_must']"}&nbsp;<font color="red">*</font>{/if}</label>
    <div class="layui-inline array-move">
        {if condition="json_decode($field['value'],true)"}
        {volist name=":json_decode($field['value'],true)" id="vo"}
        <div>
            <div class="layui-inline" style="padding-bottom: 1px;">
                <label class="layui-form-label" style="width: 45px;">键</label>
                <div class="layui-input-inline" style="width: 350px;">
                    <input type="text" name="{$field.name}[0][]"  placeholder="请输入键" autocomplete="off" class="layui-input upload-text" value="{$key}" style="height: 38px;">                        
                    <span class="sysval"><em class="zerocopy">{$field.name}</em></span>
                </div>
            </div>
            <div class="layui-inline" style="padding-bottom: 1px;">
                <label class="layui-form-label" style="width: 45px;">值</label>
                <div class="layui-input-inline" style="width: 350px;">
                    <input type="text" name="{$field.name}[1][]" placeholder="请输入值" autocomplete="off" class="layui-input upload-text" value="{$vo}" style="height: 38px;">                        
                    <span class="sysval"><em class="zerocopy">{$field.name}.{$key}</em></span>
                </div>
            </div>
            <div class="layui-inline">
                <div class="layui-form-mid"><a href="javascript:;" class="layui-btn layui-btn-xs layui-btn-danger" onclick="delinfo(this)">-</a></div>
            </div>
            <div class="layui-inline">
                <div class="layui-form-mid"><a href="javascript:;" class="layui-btn layui-btn-xs"><i class="layui-icon" style="margin-right: 0px;">&#xe622;</i></a></div>
            </div>
        </div>
        {/volist}
        {else/}
        <div>
            <div class="layui-inline" style="padding-bottom: 1px;">
                <label class="layui-form-label" style="width: 45px;">键</label>
                <div class="layui-input-inline" style="width: 350px;">
                    <input type="text" name="{$field.name}[0][]"  placeholder="请输入键" autocomplete="off" class="layui-input upload-text" value="" style="height: 38px;">                        
                    <span class="sysval"><em class="zerocopy">键</em></span>
                </div>
            </div>
            <div class="layui-inline" style="padding-bottom: 1px;">
                <label class="layui-form-label" style="width: 45px;">值</label>
                <div class="layui-input-inline" style="width: 350px;">
                    <input type="text" name="{$field.name}[1][]" placeholder="请输入值" autocomplete="off" class="layui-input upload-text" value="" style="height: 38px;">                        
                    <span class="sysval"><em class="zerocopy">值</em></span>
                </div>
            </div>
            <div class="layui-inline">
                <div class="layui-form-mid"><a href="javascript:;" class="layui-btn layui-btn-xs layui-btn-danger" onclick="delinfo(this)">-</a></div>
            </div>
            <div class="layui-inline">
                <div class="layui-form-mid"><a href="javascript:;" class="layui-btn layui-btn-xs"><i class="layui-icon" style="margin-right: 0px;">&#xe622;</i></a></div>
            </div>
        </div>
        {/if}
    </div>
    <button type="button" class="layui-btn btn-append" style="display: block;">追加</button>
</div>
{/if}
{if condition="0"}
<div class="layui-form-item layui-form-text">
    <label class="layui-form-label">{$field['title']}{if condition="isset($field['is_must'])&&$field['is_must']"}&nbsp;<font color="red">*</font>{/if}</label>
    <div class="layui-form-field-label fieldlist" data-name="{$field.name}" data-id="{$field.name}">
        <div class="arrBox"></div>
        <button type="button" class="layui-btn btn-append">追加</button>
        <textarea name="{$field.name}" class="layui-textarea layui-hide upload-text">{$field.value}</textarea>
    </div>
    {if $field.remark}<div class="layui-form-mid layui-word-aux">{$field.remark|raw}</div>{/if}
</div>
<script type="text/html" id="{$field.name}Tpl">
    <div class="layui-form-item rules-item" style="margin-bottom: 3px;margin-top:3px">
    {{# layui.each(d.lists, function(index, item) { }}
    <div class="layui-input-inline" style="width:360px;clear:none;top:0px;">
        <input type="text" class="layui-input" name="{{item.name}}[{{item.index}}][key]" placeholder="键" value="{{item.row.key|| ''}}" />
    </div>
    <div class="layui-input-inline" style="width:360px;clear:none;top:0px;margin-left:9px">
        <input type="text" class="layui-input" name="{{item.name}}[{{item.index}}][value]" placeholder="值" value="{{item.row.value|| ''}}" />
    </div>
    <label class="layui-form-mid" style="padding: 7px 0!important;margin-left:9px;">
        <button type="button" class="layui-btn layui-btn-danger btn-remove layui-btn-xs"><i class="iconfont icon-close"></i></button>
        <button type="button" class="layui-btn btn-dragsort layui-btn-xs"><i class="iconfont icon-yidong"></i></button>
    </div>
    {{# }); }}
    </div>
</script>
{/if}
{/case}
{case value="kindeditor"}<!-- kindeditor编辑器 -->
<div class="layui-form-item layui-form-text">
    <label class="layui-form-label">{$field['title']}{if condition="isset($field['is_must'])&&$field['is_must']"}&nbsp;<font color="red">*</font>{/if}<span class="sysval"><em class="zerocopy">{$field.name}</em></span></label>
    <div class="layui-input-block">
        <textarea id="{$field.name}" name="{$field.name}" placeholder="" class="layui-textarea textarea-kindeditor upload-text">{$field.value|raw}</textarea>
        {if condition="$field['remark'] or $field['name']"}<span class="layui-form-mid layui-word-aux">[ {$field.remark}&nbsp;字段名:{$field.name} ]</span>{/if}
    </div>
</div>
{/case}
{case value="ueditor"}<!-- ueditor编辑器 -->
<div class="layui-form-item layui-form-text">
    <label class="layui-form-label">{$field['title']}{if condition="isset($field['is_must'])&&$field['is_must']"}&nbsp;<font color="red">*</font>{/if}<span class="sysval"><em class="zerocopy">{$field.name}</em></span></label>
    <div class="layui-input-block">
        <div class="layui-form-field-label">
            <textarea id="{$field.name}" name="{$field.name}" placeholder="" class="textarea-ueditor upload-text">{$field.value|raw}</textarea>
        </div>
        <div class="{$field.name}_attr editor_tool">
            <a class="layui-btn layui-btn-sm" id="{$field.name}grabimg" style="margin-top: 4px;">图片本地化</a>
            <a class="layui-btn layui-btn-sm" id="{$field.name}filterword" style="margin-top: 4px;">检测违禁词</a>
        </div>
        {if condition="$field['remark'] or $field['name']"}<span class="layui-form-mid layui-word-aux">[ {$field.remark}&nbsp;字段名:{$field.name} ]</span>{/if}
    </div>
</div>
{/case}
{case value="editormd"}<!-- editormd编辑器 -->
<div class="layui-form-item layui-form-text">
    <label class="layui-form-label">{$field['title']}{if condition="isset($field['is_must'])&&$field['is_must']"}&nbsp;<font color="red">*</font>{/if}<span class="sysval"><em class="zerocopy">{$field.name}</em></span></label>
    <div class="layui-input-block">
        <div class="layui-form-field-label js-editormd" id="{$field.name}" >
            <textarea style="display:none;" name="{$field.name}" class="upload-text">{$field.value|raw}</textarea>
        </div>
        {if condition="$field['remark'] or $field['name']"}<span class="layui-form-mid layui-word-aux">[ {$field.remark}&nbsp;字段名:{$field.name} ]</span>{/if}
    </div>
</div>
{/case}
{case value="colorpicker"}<!-- 取色器 -->
<div class="layui-form-item">
    <label class="layui-form-label">{$field['title']}{if condition="isset($field['is_must'])&&$field['is_must']"}&nbsp;<font color="red">*</font>{/if}</label>
    <div class="layui-input-inline" style="width: 428px;">
        <div class="layui-input-inline" style="width: 360px;">
            <input type="text" name="{$field.name}" value="{$field.value}" placeholder="请选择颜色" class="layui-input upload-text" style="height: 38px;">
            <span class="sysval"><em class="zerocopy">{$field.name}</em></span>
        </div>
        <div class="layui-inline" style="left: -11px;">
            <div class="layui-color-box" id="{$field.name}"></div>
        </div>
        {if condition="$field['remark']"}<span class="layui-form-mid layui-word-aux">[ {$field.remark} ]</span>{/if}
    </div>
</div>
{/case}
{case value="datetime"}<!-- 日期和时间(layui.laydate) -->
<div class="layui-form-item">
    <label class="layui-form-label">{$field['title']}{if condition="isset($field['is_must'])&&$field['is_must']"}&nbsp;<font color="red">*</font>{/if}</label>
    <div class="layui-input-block">
        {php} $pformat=(!isset($field['options']['pformat'])||empty($field['options']['pformat']))?'Y-m-d H:i:s':$field['options']['pformat'];$datetimevalue = $field['value']?date($pformat,$field['value']):date($pformat,time()); {/php}
        <input type="text" data-date-type="{$field.options.type|default='datetime'}" data-date-format="{$field.options.format|default='yyyy-MM-dd HH:mm:ss'}" data-date-range="{$field.options.range|default='false'}" class="layui-input datetime upload-text" name="{$field.name}" placeholder="请输入{$field.title}" value="{$datetimevalue}">
        {if condition="$field['remark']"}<span class="layui-form-mid layui-word-aux">[ {$field.remark} ]</span>{/if}
        <span class="sysval"><em class="zerocopy">{$field.name}</em></span>
    </div>
</div>
{/case}
{case value="radio"}<!-- 单选 -->
<div class="layui-form-item">
    <label class="layui-form-label">{$field['title']}{if condition="isset($field['is_must'])&&$field['is_must']"}&nbsp;<font color="red">*</font>{/if}</label>
    <div class="layui-input-block">
        {volist name=":parse_field_attr($field['extra'])" id="vo"}
        <input type="radio" value="{$key}" {eq name="field.value" value="$key"}checked{/eq} name="{$field.name}" title="{$vo}" class="upload-radio">
        {/volist}<br/>
        {if condition="$field['remark']"}<span class="layui-form-mid layui-word-aux">[ {$field.remark} ]</span>{/if}
        <span class="sysval"><em class="zerocopy">{$field.name}</em></span>
    </div>
</div>
{/case}
{case value="checkbox"}<!-- 多选 -->
<div class="layui-form-item">
    <label class="layui-form-label">{$field['title']}{if condition="isset($field['is_must'])&&$field['is_must']"}&nbsp;<font color="red">*</font>{/if}</label>
    <div class="layui-input-block">
        {volist name=":parse_field_attr($field['extra'])" id="vo"}
        <input type="checkbox" type="checkbox" value="{$key}" name="{$field.name}[]" <?php if(in_array($key,explode(',',$field['value']))){echo "checked='checked'";}?> title="{$key}：{$vo}" lay-skin="primary" class="upload-checkbox">
        {/volist}<br>
        {if condition="$field['remark']"}<span class="layui-form-mid layui-word-aux">[ {$field.remark} ]</span>{/if}<span class="sysval"><em class="zerocopy">{$field.name}</em></span>
    </div>
</div>
{/case}
{case value="select"}<!-- option下拉 -->
<div class="layui-form-item">
    <label class="layui-form-label">{$field['title']}{if condition="isset($field['is_must'])&&$field['is_must']"}&nbsp;<font color="red">*</font>{/if}</label>
    <div class="layui-input-block">
        <select name="{$field.name}" lay-verify="required" class="upload-select">
            <option value="" selected>请选择</option>
            {volist name=":parse_field_attr($field['extra'])" id="vo"}
            <option value="{$key}" {eq name="field.value" value="$key"}selected{/eq}>{$vo}</option>
            {/volist}
        </select>
        {if condition="$field['remark']"}<span class="layui-form-mid layui-word-aux">[ {$field.remark} ]</span>{/if}
        <span class="sysval"><em class="zerocopy">{$field.name}</em></span>
    </div>
</div>
{/case}
{case value="selecto"}<!-- 下拉框(单选) -->
<div class="layui-form-item">
    <label class="layui-form-label">{$field['title']}{if condition="isset($field['is_must'])&&$field['is_must']"}&nbsp;<font color="red">*</font>{/if}</label>
    <div class="layui-input-block">
        <input type="hidden" name="{$field.name}" data-value='{:parse_field_json($field["extra"],$field["value"],"selecto")}' value="{$field.value}" class="layui-input form-selecto upload-text">
        <div id="{$field.name}" class="xm-select-demo"></div>
        {if condition="$field['remark']"}<span class="layui-form-mid layui-word-aux">[ {$field.remark} ]</span>{/if}
        <span class="sysval"><em class="zerocopy">{$field.name}</em></span>
    </div>
</div>
{/case}
{case value="selects"}<!-- 下拉框(多选) -->
<div class="layui-form-item">
    <label class="layui-form-label">{$field['title']}{if condition="isset($field['is_must'])&&$field['is_must']"}&nbsp;<font color="red">*</font>{/if}</label>
    <div class="layui-input-block">
        <input type="hidden" name="{$field.name}" data-value='{:parse_field_json($field["extra"],$field["value"],"selects")}' value="{$field.value}" class="layui-input form-selects upload-text">
        <div id="{$field.name}" class="xm-select-demo"></div>
        {if condition="$field['remark']"}<span class="layui-form-mid layui-word-aux">[ {$field.remark} ]</span>{/if}
        <span class="sysval"><em class="zerocopy">{$field.name}</em></span>
    </div>
</div>
{/case}
{case value="selectpage"}<!-- 高级下拉框 -->
<div class="layui-form-item">
    <label class="layui-form-label">{$field['title']}{if condition="isset($field['is_must'])&&$field['is_must']"}&nbsp;<font color="red">*</font>{/if}</label>
    <div class="layui-input-block" style="border: none;">
        <div class="layui-form-field-label">
            <input class="form-control layui-input selectpage upload-text" type="text" name="{$field.name}" data-source="{$field.options.url|url}" data-multiple="{$field.options.multiple|default='false'}" data-field="{$field.options.field|default='name'}" data-primary-key="{$field.options.key|default='id'}" data-max-select-limit="{$field.options.max|default='20'}" data-pagination="{$field.options.pagination|default='true'}" data-page-size="{$field.options.limit|default='10'}" data-order-by="{$field.options.order|default='id'}" value="{$field.value}">
        </div>
        {if condition="$field['remark']"}<span class="layui-form-mid layui-word-aux">[ {$field.remark} ]</span>{/if}
        <span class="sysval"><em class="zerocopy">{$field.name}</em></span>
    </div>
</div>
{/case}
{case value="city"}<!-- 城市 -->
<div class="layui-form-item">
    <label class="layui-form-label">{$field['title']}{if condition="isset($field['is_must'])&&$field['is_must']"}&nbsp;<font color="red">*</font>{/if}</label>
    <div class="layui-input-block">
        <div class="layui-form-field-label">
            <input type="text" autocomplete="on" class="layui-input upload-text" id="{$field.name}" name="{$field.name}" value="{$field.value}" data-toggle="city-picker" placeholder="请选择"/>
        </div>
        {if condition="$field['remark']"}<span class="layui-form-mid layui-word-aux">[ {$field.remark} ]</span>{/if}
        <span class="sysval"><em class="zerocopy">{$field.name}</em></span>
    </div>
</div>
{/case}
{case value="region"}<!-- 地区 -->
<div class="layui-form-item">
    <label class="layui-form-label">{$field['title']}{if condition="isset($field['is_must'])&&$field['is_must']"}&nbsp;<font color="red">*</font>{/if}</label>
    <div class="layui-input-block">
        <input type="hidden" class="form-control upload-text" name="{$field.name}" value="{$field.value}">
        <div class="filter_{$field.name}" id="filter_{$field.name}">
            <!-- 省份 -->
            <div class="layui-input-inline">
                <select id="province_{$field.name}" lay-filter="filter_{$field.name}_1">
                    <option value="" selected="">请选择</option>
                    {if condition="0"}
                    {volist name=":get_region()" id="vo"}
                    <option value="{$vo.id}">{$vo.shortname}</option>
                    {/volist}
                    {/if}
                    {volist name=":get_region_tostr($field['value'],'province')" id="vo"}
                    <?php
                        $arr =explode(',',$field['value']);
                        if(in_array($vo['id'],$arr))
                        {
                            $select = "selected";
                        }else{
                            $select = '';
                        }
                    ?>
                    <option value="{$vo.id}" <?php echo $select;?> >{$vo.shortname}</option>
                    {/volist}
                </select>
            </div>
            <!-- 城市 -->
            <div class="layui-input-inline">
                <select  id="city_{$field.name}" lay-filter="filter_{$field.name}_2">
                    <option value="" selected="">请选择</option>
                    {volist name=":get_region_tostr($field['value'],'city')" id="vo"}
                    <?php
                        $arr =explode(',',$field['value']);
                        if(in_array($vo['id'],$arr))
                        {
                            $select = "selected";
                        }else{
                            $select = '';
                        }
                    ?>
                    <option value="{$vo.id}" <?php echo $select;?> >{$vo.shortname}</option>
                    {/volist}
                </select>
            </div>
            <!-- 乡镇 -->
            <div class="layui-input-inline">
                <select  id="area_{$field.name}" lay-filter="filter_{$field.name}_3">
                    <option value="" selected="">请选择</option>
                    {volist name=":get_region_tostr($field['value'],'area')" id="vo"}
                    <?php
                        $arr =explode(',',$field['value']);
                        if(in_array($vo['id'],$arr))
                        {
                            $select = "selected";
                        }else{
                            $select = '';
                        }
                    ?>
                    <option value="{$vo.id}" <?php echo $select;?> >{$vo.shortname}</option>
                    {/volist}
                </select>
            </div>
            <div class="layui-input-inline" style="float: right;">
                {if condition="$field['remark']"}<span class="layui-form-mid layui-word-aux">[ {$field.remark} ]</span>{/if}
                <span class="sysval"><em class="zerocopy">{$field.name}</em></span>
            </div>
        </div>
        <script type="text/javascript">
            // 第一种方法 原生
            /* $("#filter_{$field.name} select").live('change',function(data){
                var that = $(this);
                changeCity(that);
            }); */
            // 第二种方法 layui
            layui.use(['form','jquery'], function(){
                var form = layui.form
                ,$ = layui.jquery;
                // 监听select 省份
                form.on('select(filter_{$field.name}_1)', function(data){
                    var that = $(data.elem);
                    changeCity(that);
                });
                // 监听select 城市
                form.on('select(filter_{$field.name}_2)', function(data){
                    var that = $(data.elem);
                    changeCity(that);
                });
                // 监听select 乡镇
                form.on('select(filter_{$field.name}_3)', function(data){
                    var that = $(data.elem);
                    changeCity(that);
                });
            });
        </script>
    </div>
</div>
{/case}
{case value="map"}<!-- 地图 -->
<div class="layui-form-item">
    <label class="layui-form-label">{$field['title']}{if condition="isset($field['is_must'])&&$field['is_must']"}&nbsp;<font color="red">*</font>{/if}</label>
    <div class="layui-input-block">
        <input name="{$field.name}" id="dr_{$field.name}" type="hidden" value="{$field.value}" class="upload-text">
        <div class="layui-input-inline" style="width: 80px;">
            <select name="province_{$field.name}" lay-filter="province_{$field.name}">
                <option value="" selected="">省</option>
                {volist name=":get_region()" id="province"}
                <option value="{$province.id}">{$province.name}</option>
                {/volist}
            </select>
        </div>
        <div class="layui-input-inline" style="width: 80px;">
            <select name="city_{$field.name}" lay-filter="city_{$field.name}">
                <option value="" selected="">市</option>
            </select>
        </div>
        <div class="layui-input-inline" style="width: 80px;">
            <select name="couty_{$field.name}" lay-filter="couty_{$field.name}">
                <option value="">县/区</option>
            </select>
        </div>
        <div class="layui-input-inline" style="width: 390px;">
            <input type="text" id="baidu_address_{$field.name}" value="{$field.value}" placeholder="请输入详细地址" autocomplete="off" class="layui-input">
            <span class="sysval"><em class="zerocopy">{$field.name}</em></span>
        </div>
        <div class="layui-input-inline" style="width:80px">
            <a class="layui-btn " href="javascript:;" onclick="baiduSearchAddress(new BMap.Map('baidumap_{$field.name}'), '{$field.name}', '11');" style="text-decoration:none;">
                <i class="layui-icon"></i>
            </a>
        </div>
        <div class="layui-form-item" style="margin-bottom: -4px;">
            <div class="layui-inline" style="width: 600px;">
                <div style="width:722px;height:300px;clear:both;" id="baidumap_{$field.name}"></div>
            </div>
        </div>
        <script type="text/javascript">
            // 百度地图API功能
            var map_{$field.name} = new BMap.Map("baidumap_{$field.name}");
            var data = "{$field.value}";
            var data = data.split(',');
            var lngX = data[0];
            var latY = data[1];
            var point = new BMap.Point(lngX,latY);
            map_{$field.name}.centerAndZoom(point,13);
            setTimeout(function(){
            map_{$field.name}.setZoom(11);
            }, 2000);  //2秒后放大到14级
            map_{$field.name}.enableScrollWheelZoom(true);
            var marker = new BMap.Marker(point);//创建标注
            map_{$field.name}.clearOverlays();
            map_{$field.name}.addOverlay(marker);//将标注添加到地图中
            marker.disableDragging();
            map_{$field.name}.addEventListener("click",function(e){
                $('#dr_{$field.name}').val(e.point.lng+','+e.point.lat);
                marker.point.lng = e.point.lng;
                marker.point.lat = e.point.lat;
                var point2 = new BMap.Point(e.point.lng,e.point.lat);
                var marker2 = new BMap.Marker(point2);// 创建标注
                map_{$field.name}.clearOverlays();
                map_{$field.name}.addOverlay(marker2);
                marker.disableDragging();
            });
            layui.use(['form','layer', 'element','jquery'], function(){
                var form = layui.form //表单
                ,element = layui.element //元素操作
                ,layer = layui.layer //弹层
                ,$ = layui.jquery;
                form.on('select(province_{$field.name})', function(data){
                    $("select[name='couty_{$field.name}']").html("<option value='' selected=''>请选择县/区</option>");
                    $.ajax({
                        type:"POST",
                        dataType: 'JSON',
                        data:{id:data.value,type:2},
                        url:GV.ajax_get_city,
                        success:function(data){
                            var html = "";
                            html+="<option value='' selected=''>请选择市</option>";
                            $(data).each(function(k,v){
                                html+="<option value='"+v.id+"'>"+v.name+"</option>";
                            });
                            // alert(html);
                            $("select[name='city_{$field.name}']").html(html);
                            form.render('select');
                        }
                    });
                    // console.log(data.elem); //得到select原始DOM对象
                    // console.log(data.value); //得到被选中的值
                    // console.log(data.othis); //得到美化后的DOM对象
                });
                form.on('select(city_{$field.name})', function(data){
                    $.ajax({
                        type:"POST",
                        dataType: 'JSON',
                        data:{id:data.value,type:3},
                        url:GV.ajax_get_city,
                        success:function(data){
                            var html = "";
                            html+="<option value='' selected=''>请选择县/区</option>";
                            $(data).each(function(k,v){
                                html+="<option value='"+v.id+"'>"+v.name+"</option>";
                            });
                            // alert(html);
                            $("select[name='couty_{$field.name}']").html(html);
                            form.render('select');
                        }
                    });
                });
                form.on('select(couty_{$field.name})', function(data){
                    theLocation('couty_{$field.name}',map_{$field.name});
                });
            });
        </script>
    </div>
</div>
{/case}
{case value="stepselect"}<!-- 联动类型 -->
<div class="layui-form-item">
    <label class="layui-form-label">{$field['title']}{if condition="isset($field['is_must'])&&$field['is_must']"}&nbsp;<font color="red">*</font>{/if}</label>
    <div class="layui-input-block">
        <input type="hidden" class="form-control upload-text" name="{$field.name}" value="{$field.value}">
        <div id="div_{$field.name}">
            <div class="layui-input-inline">
                <select name="" id="step_{$field.name}_0" lay-filter="div_{$field.name}">
                    <option value="" selected="">请选择  </option>
                    {volist name=":get_stepsclect($field['name'])" id="vo"}
                    <?php
                        $arr =explode(',',$field['value']);
                        if(in_array($vo['id'],$arr))
                        {
                            $select = "selected";
                        }else{
                            $select = '';
                        }
                    ?>
                    <option value="{$vo.id}" <?php echo $select;?> >{$vo.title}</option>
                    {/volist}
                </select>
            </div>
        </div>
        <div class="layui-input-inline" style="float:right;">
            {if condition="$field['remark']"}<span class="layui-form-mid layui-word-aux">[ {$field.remark} ]</span>{/if}
            <span class="sysval"><em class="zerocopy">{$field.name}</em></span>
        </div>
        <script type="text/javascript">
            // 页面加载完执行
            window.onload =  function () {
                changeSelected('{$field.name}');
            }
            // 第二种方法 layui
            layui.use(['form','jquery'], function(){
                var form = layui.form //表单
                ,$ = layui.jquery;
                // 监听select
                form.on('select(div_{$field.name})', function(data){
                    var that = $(data.elem);
                    changeStep(that);
                });
            });
        </script>
    </div>
</div>
{/case}
{case value="picture"}<!-- 上传单图 -->
<div class="layui-form-item">
    <label class="layui-form-label">{$field['title']}{if condition="isset($field['is_must'])&&$field['is_must']"}&nbsp;<font color="red">*</font>{/if}</label>
    <div class="layui-input-inline" style="width: 850px;">
        <input type="file" filename="{$field.name}" filetype="one" isajax="1" iscrop="{$field.options.iscrop|default=0}" data-size="{$field.options.size|default=0}" data-ext="{$field.options.ext|default=''}" data-thumb="{$field.options.thumb|default=''}" data-watermark="{$field.options.watermark|default=''}" class="upload-file {$field.name}" style="display: none">
        <input type="text" name="{$field.name}" value="{$field.value|default=''}" class="layui-input upload-text" style="float:left;margin-right:-2px;width:300px;height: 38px;">
        <input type="button" value="浏览..." onclick="SelectImage('{$field.name}');" class="layui-btn layui-btn-normal">
        <input type="button" value="站内选择" onclick="x_admin_show('站内选择','{:url('File/index',['filename'=>$field['name']])}')" class="layui-btn layui-btn-primary">
        <input type="button" value="选择" onclick="x_admin_show('选择','{:url('Attachment/index',['filename'=>$field['name']])}')" class="layui-btn layui-btn-primary">
        <input type="button" value="裁剪" onclick="caijian('{$field.name}');" class="layui-btn layui-btn-primary">
        <input type="button" value="{$field.name}" class="layui-btn layui-btn-primary" style="background: #EDF6FF;">
    </div>
    {if condition="$field['value']"}
    <div class="layui-inline thumb_list" id="{$field.name}" style="padding-top: 0px;">
        <span>
            <img src="{$field['value']|get_file_path=###}" alt="" height="100px;" width="100px" data-image>
            <button type="button" filename="{$field.name}" filevalue="{$field['value']}" onclick="delimg(this);" class="layui-btn layui-btn-danger layui-btn-mini delimg">
                <i class="layui-icon">&#xe640;</i>
            </button>
        </span>
    </div>
    {else /}
    <div class="layui-inline thumb_list" id="{$field.name}" style="padding-top: 0px;">
    </div>
    {/if}
</div>
{/case}
{case value="piclist"}<!-- 上传多图 -->
<div class="layui-form-item">
    <label class="layui-form-label">{$field['title']}{if condition="isset($field['is_must'])&&$field['is_must']"}&nbsp;<font color="red">*</font>{/if}</label>
    <div class="layui-inline">
        <div class="layui-input-inline" style="width: 850px;">
            <input type="file" filename="{$field.name}" filetype="list" isajax="1" iscrop="1" data-size="" data-ext="" data-thumb="" data-watermark="" class="upload-file {$field.name}" style="display: none">
            <input type="text" name="{$field.name}" value="{$field.value|default=''}" class="layui-input upload-text" style="float:left;margin-right:-2px;width:300px;height: 38px;">
            <input type="button" value="浏览..." onclick="SelectImage('{$field.name}');" class="layui-btn layui-btn-normal">
            <input type="button" value="站内选择" onclick="x_admin_show('站内选择','{:url('File/index',['filename'=>$field['name']])}')" class="layui-btn layui-btn-primary">
            <input type="button" value="选择" onclick="x_admin_show('选择','{:url('Attachment/index',['filename'=>$field['name']])}')" class="layui-btn layui-btn-primary">
            <input type="button" value="{$field.name}" class="layui-btn layui-btn-primary" style="background: #EDF6FF;">
            {if condition="$field['value']"}
            <div class ="thumb_list" id="{$field.name}">
                <?php foreach(explode(',',$field['value']) as $k=>$v):?>
                <div class="img-div">
                    <img src="{$v|get_file_path=###}" alt="" height="100px;" width="100px" data-image>
                    <button type="button" filename="{$field.name}" filevalue="{$v}" onclick="delimg(this);" class="layui-btn layui-btn-danger layui-btn-mini delimg">
                        <i class="layui-icon">&#xe640;</i>
                    </button>
                </div>
                <?php endforeach;?>
            </div>
            {else/}
            <div class ="thumb_list" id="{$field.name}"></div>
            {/if}
        </div>
    </div>
</div>
{/case}
{case value="image"}<!-- 单图 -->
<div class="layui-form-item layui-form-text">
    <label class="layui-form-label">{$field['title']}{if condition="isset($field['is_must'])&&$field['is_must']"}&nbsp;<font color="red">*</font>{/if}<span class="sysval"><em class="zerocopy">{$field.name}</em></span></label>
    <div class="layui-input-block" style="top: 0px;">
        <div class="layui-form-field-label">
            <div class="js-upload-image">
                <div id="file_list_{$field.name}" class="uploader-list">
                    {notempty name="$field.value"}
                    <div class="file-item thumbnail">
                        <img data-image class="{$field.name}-{$field.value}" data-original="{$field.value|get_file_path|default='__STATIC__/admin/img/none.png'}" src="{$field.value|get_file_path|default='__STATIC__/admin/img/none.png'}">
                        <div class="file-panel">
                            <i class="iconfont icon-tailor cropper" data-input-id="{$field.value}" data-id="{$field.name}"></i>
                            <i class="iconfont icon-trash remove-picture" data-id="{$field.value}"></i>
                        </div>
                    </div>
                    {/notempty}
                </div>
                <input type="hidden" name="{$field.name}" data-multiple="false" data-watermark='' data-thumb='' data-size="{:sys_config('upload_image_size')}" data-ext="{:sys_config('upload_image_ext')}" id="{$field.name}" value="{$field.value|default=''}" class="upload-text">
                <div class="layui-clear"></div>
                <div id="picker_{$field.name}"><i class="layui-icon layui-icon-upload"></i> 上传单张图片</div>
                <button type="button" class="layui-btn fachoose-image" data-input-id="{$field.name}" id="fachoose-{$field.name}"><i class="iconfont icon-other"></i> 选择</button>
            </div>
        </div>
    </div>
</div>
{/case}
{case value="images"}<!-- 多图 -->
<div class="layui-form-item layui-form-text">
    <label class="layui-form-label">{$field['title']}{if condition="isset($field['is_must'])&&$field['is_must']"}&nbsp;<font color="red">*</font>{/if}<span class="sysval"><em class="zerocopy">{$field.name}</em></span></label>
    <div class="layui-input-block" style="top: 0px;">
        <div class="layui-form-field-label">
            <div class="js-upload-images">
                <div id="file_list_{$field.name}" class="uploader-list">
                    {notempty name="$field.value"}
                    {volist name="$field.value|explode=',',###" id="v"}
                    <div class="file-item thumbnail">
                        <img data-image class="{$field.name}-{$v}" data-original="{$v|get_file_path}" src="{$v|get_file_path|default='__STATIC__/admin/img/none.png'}">
                        <div class="file-panel">
                            <i class="iconfont icon-yidong move-picture"></i>
                            <i class="iconfont icon-tailor cropper" data-input-id="{$v}" data-id="{$field.name}"></i>
                            <i class="iconfont icon-trash remove-picture" data-id="{$v}"></i>
                        </div>
                    </div>
                    {/volist}
                    {/notempty}
                </div>
                <input type="hidden" name="{$field.name}" data-multiple="true" data-watermark='' data-thumb='' data-size="{:sys_config('upload_image_size')}" data-ext="{:sys_config('upload_image_ext')}" id="{$field.name}" value="{$field.value|default=''}" class="upload-text">
                <div class="layui-clear"></div>
                <div id="picker_{$field.name}"><i class="layui-icon layui-icon-upload"></i> 上传多张图片</div>
                <button type="button" class="layui-btn fachoose-image" data-multiple="true" data-input-id="{$field.name}" id="fachoose-{$field.name}"><i class="iconfont icon-other"></i> 选择</button>
            </div>
        </div>
    </div>
</div>
{/case}
{case value="file"}<!-- 上传单文件 -->
<div class="layui-form-item">
    <label class="layui-form-label">{$field['title']}{if condition="isset($field['is_must'])&&$field['is_must']"}&nbsp;<font color="red">*</font>{/if}</label>
    <div class="layui-input-inline" style="width: 850px;">
        <input type="file" filename="{$field.name}" filetype="onefile" isajax="1" iscrop="0" data-size="" data-ext="" class="upload-file {$field.name}" style="display: none">
        <input type="text" name="{$field.name}" value="{$field.value|default=''}" class="layui-input upload-text" style="float:left;margin-right:-2px;width:300px;height: 38px;">
        <input type="button" value="浏览..." onclick="SelectImage('{$field.name}');" class="layui-btn layui-btn-normal">
        <input type="button" value="站内选择" onclick="x_admin_show('站内选择','{:url('File/index',['filename'=>$field['name']])}')" class="layui-btn layui-btn-primary">
        <input type="button" value="选择" onclick="x_admin_show('选择','{:url('Attachment/index',['filename'=>$field['name']])}')" class="layui-btn layui-btn-primary">
        <input type="button" value="{$field.name}" class="layui-btn layui-btn-primary" style="background: #EDF6FF;">
    </div>
    {if condition="$field['value']"}
    <div class="layui-inline thumb_list" id="{$field.name}" style="padding-top: 0px;">
        <div class="upload-pre-file"><i class="fa fa-paperclip"></i> <?php echo basename($field['value']);?><a href="javascript:;" onclick="delimg(this);" filename="{$field.name}" filevalue="{$field['value']|default=''}"> <i class="fa fa-trash-o"></i></a></div>
    </div>
    {else /}
    <div class="layui-inline thumb_list" id="{$field.name}" style="padding-top: 0px;">
    </div>
    {/if}
</div>
{/case}
{case value="filelist"}<!-- 上传多文件 -->
<div class="layui-form-item">
    <label class="layui-form-label">{$field['title']}{if condition="isset($field['is_must'])&&$field['is_must']"}&nbsp;<font color="red">*</font>{/if}</label>
    <div class="layui-inline">
        <div class="layui-input-inline" style="width: 850px;">
            <input type="file" filename="{$field.name}" filetype="filelist" isajax="1" iscrop="0" data-size="" data-ext="" class="upload-file {$field.name}" style="display: none">
            <input type="text" name="{$field.name}" value="{$field.value|default=''}" class="layui-input upload-text" style="float:left;margin-right:-2px;width:300px;height: 38px;">
            <input type="button" value="浏览..." onclick="SelectImage('{$field.name}');" class="layui-btn layui-btn-normal">
            <input type="button" value="站内选择" onclick="x_admin_show('站内选择','{:url('File/index',['filename'=>$field['name']])}')" class="layui-btn layui-btn-primary">
            <input type="button" value="选择" onclick="x_admin_show('选择','{:url('Attachment/index',['filename'=>$field['name']])}')" class="layui-btn layui-btn-primary">
            <input type="button" value="{$field.name}" class="layui-btn layui-btn-primary" style="background: #EDF6FF;">
            {if condition="$field['value']"}
            <div class ="thumb_list" id="{$field.name}">
                <?php foreach(explode(',',$field['value']) as $k=>$v):?>
                <div class="img-div">
                    <div class="upload-pre-file">
                        <i class="fa fa-paperclip"></i> <?php echo basename($v);?>
                        <button type="button" onclick="delimg(this);" filename="{$field.name}" filevalue="{$v}" style="background-color: transparent;border: 0;"> 
                            <i class="fa fa-trash-o"></i>
                        </button>
                    </div>
                </div>
                <?php endforeach;?>
            </div>
            {else/}
            <div class ="thumb_list" id="{$field.name}"></div>
            {/if}
        </div>
    </div>
</div>
{/case}
{case value="fileo"}<!-- 单文件 -->
<div class="layui-form-item layui-form-text">
    <label class="layui-form-label">{$field['title']}{if condition="isset($field['is_must'])&&$field['is_must']"}&nbsp;<font color="red">*</font>{/if}<span class="sysval"><em class="zerocopy">{$field.name}</em></span></label>
    <div class="layui-input-block">
        <div class="layui-form-field-label" style="margin-top: -9px;">
            <div class="js-upload-file">
                <div id="file_list_{$field.name}" class="uploader-list">
                    <table class="layui-table">
                        <colgroup>
                            <col width="150">
                            <col width="150">
                            <col width="150">
                            <col>
                        </colgroup>
                        <thead>
                        <tr>
                            <th>文件名称</th>
                            <th>提示</th>
                            <th>进度</th>
                            <th>操作</th>
                        </tr>
                        </thead>
                        <tbody class="file-box">
                        {notempty name="$field.value"}
                        <tr class="file-item">
                            <td>{$field.value|get_file_name}</td>
                            <td>/</td>
                            <td>/</td>
                            <td><a href="{$field.value|get_file_path}" class="layui-btn download-file layui-btn layui-btn-xs">下载</a> <a href="javascript:void(0);" class="layui-btn remove-file layui-btn layui-btn-xs layui-btn-danger">删除</a></td>
                        </tr>
                        {/notempty}
                        </tbody>
                    </table>
                </div>
                <input type="hidden" name="{$field.name}" data-multiple="false" data-size="{:sys_config('upload_file_size')}" data-ext="{:sys_config('upload_file_ext')}" id="{$field.name}" value="{$field.value|default=''}" class="upload-text">
                <div id="picker_{$field.name}"><i class="layui-icon layui-icon-upload"></i> 上传单个文件</div>
            </div>
        </div>
    </div>
</div>
{/case}
{case value="files"}<!-- 多文件 -->
<div class="layui-form-item layui-form-text">
    <label class="layui-form-label">{$field['title']}{if condition="isset($field['is_must'])&&$field['is_must']"}&nbsp;<font color="red">*</font>{/if}<span class="sysval"><em class="zerocopy">{$field.name}</em></span></label>
    <div class="layui-input-block">
        <div class="layui-form-field-label" style="margin-top: -9px;">
            <div class="js-upload-file">
                <div id="file_list_{$field.name}" class="uploader-list">
                    <table class="layui-table">
                        <colgroup>
                            <col width="150">
                            <col width="150">
                            <col width="150">
                            <col>
                        </colgroup>
                        <thead>
                            <tr>
                                <th>文件名称</th>
                                <th>提示</th>
                                <th>进度</th>
                                <th>操作</th>
                            </tr>
                        </thead>
                        <tbody class="file-box">
                        {notempty name="$field.value"}
                        {volist name="$field.value|explode=',',###" id="v"}
                            <tr class="file-item">
                                <td>{$v|get_file_name}</td>
                                <td>/</td>
                                <td>/</td>
                                <td><a href="{$v|get_file_path}" class="layui-btn download-file layui-btn layui-btn-xs">下载</a> <a href="javascript:void(0);" class="layui-btn remove-file layui-btn layui-btn-xs layui-btn-danger" data-id="{$v}">删除</a></td>
                            </tr>
                        {/volist}
                        {/notempty}
                        </tbody>
                    </table>
                </div>
                <input type="hidden" name="{$field.name}" data-multiple="true" data-size="{:sys_config('upload_file_size')}" data-ext="{:sys_config('upload_file_ext')}" id="{$field.name}" value="{$field.value|default=''}" class="upload-text">
                <div id="picker_{$field.name}"><i class="layui-icon layui-icon-upload"></i> 上传多个文件</div>
            </div>
        </div>
    </div>
</div>
{/case}
{case value="onevideo"}<!-- 上传单视频 -->
<div class="layui-form-item">
    <label class="layui-form-label">{$field['title']}{if condition="isset($field['is_must'])&&$field['is_must']"}&nbsp;<font color="red">*</font>{/if}</label>
    <div class="layui-input-inline" style="width: 850px;">
        <input type="file" filename="{$field.name}" filetype="onevideo" isajax="1" iscrop="0" data-size="" data-ext="" class="upload-file {$field.name}" style="display: none">
        <input type="text" name="{$field.name}" value="{$field.value|default=''}" class="layui-input upload-text" style="float:left;margin-right:-2px;width:300px;height: 38px;">
        <input type="button" value="浏览..." onclick="SelectImage('{$field.name}');" class="layui-btn layui-btn-normal">
        <input type="button" value="站内选择" onclick="x_admin_show('站内选择','{:url('File/index',['filename'=>$field['name']])}')" class="layui-btn layui-btn-primary">
        <input type="button" value="选择" onclick="x_admin_show('选择','{:url('Attachment/index',['filename'=>$field['name']])}')" class="layui-btn layui-btn-primary">
        <input type="button" value="{$field.name}" class="layui-btn layui-btn-primary" style="background: #EDF6FF;">
    </div>
    {if condition="$field['value']"}
    <div class="layui-inline thumb_list" id="{$field.name}">
        <span>
            <video width="100px" height="100px" controls="controls">
                <source src="{$field['value']|get_file_path=###}" type="video/mp4">
            </video>
            <button type="button" filename="{$field.name}" filevalue="{$field['value']}" onclick="delimg(this);" class="layui-btn layui-btn-danger layui-btn-mini delimg">
                <i class="layui-icon">&#xe640;</i>
            </button>
        </span>
    </div>
    {else /}
    <div class="layui-inline thumb_list" id="{$field.name}" style="padding-top: 0px;"></div>
    {/if}
</div>
{/case}
{case value="videolist"}<!-- 上传多视频 -->
<div class="layui-form-item">
    <label class="layui-form-label">{$field['title']}{if condition="isset($field['is_must'])&&$field['is_must']"}&nbsp;<font color="red">*</font>{/if}</label>
    <div class="layui-inline">
        <div class="layui-input-inline" style="width: 850px;">
            <input type="file" filename="{$field.name}" filetype="videolist" isajax="1" iscrop="0" data-size="" data-ext="" class="upload-file {$field.name}" style="display: none">
            <input type="text" name="{$field.name}" value="{$field.value|default=''}" class="layui-input upload-text" style="float:left;margin-right:-2px;width:300px;height: 38px;">
            <input type="button" value="浏览..." onclick="SelectImage('{$field.name}');" class="layui-btn layui-btn-normal">
            <input type="button" value="站内选择" onclick="x_admin_show('站内选择','{:url('File/index',['filename'=>$field['name']])}')" class="layui-btn layui-btn-primary">
            <input type="button" value="选择" onclick="x_admin_show('选择','{:url('Attachment/index',['filename'=>$field['name']])}')" class="layui-btn layui-btn-primary">
            <input type="button" value="{$field.name}" class="layui-btn layui-btn-primary" style="background: #EDF6FF;">
            {if condition="$field['value']"}
            <div class ="thumb_list" id="{$field.name}">
                <?php foreach(explode(',',$field['value']) as $k=>$v):?>
                <div class="img-div">
                    <video width="100px" height="100px" controls="controls">
                        <source src="{$v|get_file_path=###}" type="video/mp4">
                    </video>
                    <button type="button" filename="{$field.name}" filevalue="{$v}" onclick="delimg(this);" class="layui-btn layui-btn-danger layui-btn-mini delimg">
                        <i class="layui-icon">&#xe640;</i>
                    </button>
                </div>
                <?php endforeach;?>
            </div>
            {else/}
            <div class ="thumb_list" id="{$field.name}"></div>
            {/if}
        </div>
    </div>
</div>
{/case}
{case value="custom"}<!-- 自定义 -->
    <?php echo \think\Response::create('admin@custom/' . $field['custom'], 'view')->assign('field', $field)->getContent();?>
{/case}
{default/}<!-- 默认 -->
<div class="layui-form-item">
    <label class="layui-form-label">{$field['title']}{if condition="isset($field['is_must'])&&$field['is_must']"}&nbsp;<font color="red">*</font>{/if}</label>
    <div class="layui-input-block">
        <input type="text" name="{$field.name}" value="{$field.value}" placeholder="" autocomplete="off" class="layui-input upload-text">
        {if condition="$field['remark']"}<span class="layui-form-mid layui-word-aux">[ {$field.remark} ]</span>{/if}
        <span class="sysval"><em class="zerocopy">{$field.name}</em></span>
    </div>
</div>
{/switch}